<?php
$this->placeholder("navegacion")->set($this->navegacion($this->nav));

$appConfig = Zend_Registry::get("appConfig");
$domConfig = Zend_Registry::get("domConfig");

$perfil = App_Perfil::getInstance();
$perfil->cargar("ADMIN_USUARIOS_SEDES");
?>
<BR>
<div align="center">
<div style="width: 700px" class="center-block">
	<table width="100%" align="center" class="iceDatTbl">
    <tr>
      <th><?php echo $this->datossede["nombresede"]; ?></th>
    </tr>
 	<tr>
      <th>Informaci&oacute;n para la asignaci&oacute;n</th>
    </tr>
    </table>
    <?php if ($perfil->crear()): ?>
			<?php
        	    echo $this->form;
        	?>
      <?php endif;?>
 </div>
<?php if(count($this->datos)>0):?>
<BR>
<form action="<?=$this->baseUrl("/sedes/index/desasignarusuario");?>" method="post">
<INPUT type="hidden" name="codsede" name="codsede" value="<?php echo $this->datossede["codsede"]; ?>">
<table id="table_id" align="center" class="display">
  <thead>
    <tr>
      <th width="10%">Usuario</th>
      <th width="46%">Nombre / correo</th>
      <th width="20%">Tipo de permiso</th>
      <th width="10%">Estado</th>
	  <th width="4%"></th>
    </tr>
  </thead>
  <tbody>
	<?php foreach ($this->datos as $value):?>
    <tr>
      <td style="text-align:center;"><?php echo $value["nombreusuario"];?></td>
      <td><?php echo "{$value["nombres"]} {$value["apellidos"]}";?></td>
      <td style="text-align:center;"><?php echo ($value["tipousuario"]=='R')?"Crear, modificar y finalizar ":"Modicar";?></td>
      <td style="text-align:center;"><?php echo $domConfig->DOM_ESTADO->get($value["estado"]);?></td>
	  <td style="text-align:center;"><input type="checkbox" name="seleccionados[]" value="<?=$value["codusuario"];?>" /></td>
    </tr>
  <?php  endforeach;?>
  </tbody>
</table>
<?php
    if($perfil->eliminar()) {
?>
<div align="right"><input type="submit" value="Des-asignar usuario" class="btn btn-primary btn-sm" /></div>
<?php
    }
?>
</form>
<script type="text/javascript">
$(function() {
	var oTable = $('#table_id').dataTable({
		"bJQueryUI": true,
		"bAutoWidth": false,
 		"sPaginationType": "full_numbers",
 		"bStateSave": true,
 		"aoColumns": [
 	 		 			null,
 	 		 			null,
 	 		 			null,
 	 		 			null,
 	 		 			{ "bSortable": false, "bSearchable": false }
 	 		 		 ]
	});
	oTable.fnSetFilteringDelay();
});
</script>
<?php else: echo "<BR>".$this->mensajes("No existen registros");?>
<?php endif; ?>
</div>